/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.io.Serializable;
import java.util.List;

import controll.Mapping;

/**
 *
 * @author phuc
 */
public class Ga implements Serializable {
    private static final long serialVersionUID = 1L;
    private Long gaID;
    private String ten;
    private String diaChi;
    private String sdt;
    private List<BangGia> bangGiaListDen;
    private List<BangGia> bangGiaListDi;
    private List<ChiTietHoaDon> chiTietHoaDonDiList;
    private List<ChiTietHoaDon> chiTietHoaDonDenList;
    private List<GioTau> gioTauList;
    private Mapping map  = null;
    
    public Ga() {
    }

    public Ga(Long gaID) {
        this.gaID = gaID;
    }

    public Ga(Long gaID, String ten, String diaChi) {
        this.gaID = gaID;
        this.ten = ten;
        this.diaChi = diaChi;
    }

    public Long getGaID() {
        return gaID;
    }

    public void setGaID(Long gaID) {
        this.gaID = gaID;
    }

    public String getTen() {
        return ten;
    }

    public void setTen(String ten) {
        this.ten = ten;
    }

    public String getDiaChi() {
        return diaChi;
    }

    public void setDiaChi(String diaChi) {
        this.diaChi = diaChi;
    }

    public String getSdt() {
        return sdt;
    }

    public void setSdt(String sdt) {
        this.sdt = sdt;
    }

    /**
     * Get list Bang Gia den
     * @return
     */
    public List<BangGia> getListBangGiaDen() {
    	map = new Mapping();
    	return map.getListBangGiaDen(this);
    }

    /**
     * Get  list Bang Gia di
     * @return
     */
    public List<BangGia> getListBangGiaDi() {
    	map = new Mapping();
    	return map.getListBangGiaDi(this);
    }

    public List<ChiTietHoaDon> getChiTietHoaDonDiList() {
    	map = new Mapping();
    	return map.getChiTietHoaDonDiList(this);
    }

    public List<ChiTietHoaDon> getChiTietHoaDonDenList() {
    	map = new Mapping();
    	return map.getChiTietHoaDonDenList(this);
    }

    public List<GioTau> getGioTauList() {
    	map = new Mapping();
    	return map.getGioTauList(this);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (gaID != null ? gaID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Ga)) {
            return false;
        }
        Ga other = (Ga) object;
        if ((this.gaID == null && other.gaID != null) || (this.gaID != null && !this.gaID.equals(other.gaID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.Ga[ gaID=" + gaID + " ]";
    }

	public Ga getGaByGaID(long gaID) {
		return map.getGaByGaID(gaID);
	}
    
}
